import request from '../utils/request'

/**
 * 获取用户信息
 * @paran {code,introduce,manager,name,pid} data
 */
// 新增
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 查询
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 修改
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 删除
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 查询部门
export function bumenDepartments(id) {
  return request({
    url: `/company/department/${id}`
  })
}
